#include<stdio.h>
int main(void)
{
	char ch;
	int count=0,F=1;
	ch = getchar();
	while (ch != '\n')
    {
		if (ch != ' ' && F == 1)
        {
			count ++;
			F = 0;
		}
		if (ch == ' ')
			F = 1;
		ch = getchar();
	}
	printf("%d", count);
	return 0;
}